Create a Dynamic Web Template

To create a Dynamic Web Template (DWT), you start with an empty HTML page and save it as a .dwt file. Then you add editable regions so that you can change the content in pages attached to this DWT.

When you save a DWT with attached files, Microsoft Expression Web prompts you to update those files.

Note

DWTs use metadata to maintain the relationship between a .dwt file and the pages attached to the .dwt file. If the pages attached to a DWT are not correctly updated after Expression Web prompts you to update the files, synchronize the metadata by clicking Site, and then clicking Recalculate Hyperlinks. You can then update the attached pages by clicking Format, pointing to Dynamic Web Template, and then clicking Update Attached Pages.

For more information about metadata or on updating pages attached to a DWT, see Add or remove metadata or Update web pages attached to a Dynamic Web Template.

To create a Dynamic Web Template

  1. On the File menu, click New.

  2. In the New dialog box, on the Page tab, in the left column click General, in the center column click Dynamic Web Template, and then click OK.

To create a Dynamic Web Template from an HTML file

Create or open an HTML file and do one of the following:

  • Add one or more editable regions to the page. On the File menu, click Save.

    For more information, see the procedure "To add an editable region to a Dynamic Web Template."

    Note

    Because editable regions have already been added to the page, by default the file name extension will be .dwt.

  • On the File menu, click Save As. In the Save as type list, click Dynamic Web Template, and then click Save.

You can create as many or as few editable regions as you want. Presumably, you'll want at least one so that each page using the template can present its own unique content. However, there's usually no advantage in creating lots of small editable regions that touch each other. A single, larger editable area would work just as well.

To add an editable region to a Dynamic Web Template

  1. Select the element that you want to define as an editable region.

    Note

    If you do not select an element, the element preceding the location of the cursor will be defined as the editable region.

  2. Do one of the following:

    • In Design view, right-click the Dynamic Web Template, and then click Manage Editable Regions.

    • On the Dynamic Web Template toolbar, click Manage Editable Regions Cc295595.bf2ff03b-0227-4986-aba8-0fc83a50ba3a(en-us,Expression.40).png.

  3. In the Editable Regions dialog box, in the Region name dialog box, type a name for the editable region and then click Add. Repeat to add additional editable regions.

A new editable region appears on the page. When an editable region is selected in a .dwt file, it has an orange border and includes a tab with the name of the region.

Cc295595.9c381d7c-a644-42df-8fa5-cc32c1a76301(en-us,Expression.40).png

To view the editable regions in a .dwt file when the regions are not selected, make sure Visual Aids are turned on. On the View menu, click Visual Aids, and then click Show. After Visual Aids are turned on, on the View menu, click Visual Aids, and then click Template Region Labels. For more information about visual aids, see Visual aids.

To rename an editable region in a Dynamic Web Template

  1. Select the editable region that you want to rename.

  2. Do one of the following:

    • In Design view, right-click the Dynamic Web Template, and then click Manage Editable Regions.

    • On the Dynamic Web Template toolbar, click Manage Editable Regions Cc295595.bf2ff03b-0227-4986-aba8-0fc83a50ba3a(en-us,Expression.40).png.

  3. In the Editable Regions dialog box, in the Region name box, type the new name, and then click Rename.

To remove an editable region from a Dynamic Web Template

  1. Select the editable region that you want to remove.

  2. Do one of the following:

    • In Design view, right-click the Dynamic Web Template, and then click Manage Editable Regions.

    • On the Dynamic Web Template toolbar, click Manage Editable Regions Cc295595.bf2ff03b-0227-4986-aba8-0fc83a50ba3a(en-us,Expression.40).png.

  3. Make sure that the editable region that you want to remove is selected, and then click Remove.

See also

Tasks

Attach or detach a Dynamic Web Template
Attach a different Dynamic Web Template
Update web pages attached to a Dynamic Web Template

Reference

Dynamic Web Template toolbar

Concepts

Controlling page layout with Dynamic Web Templates

Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.